/*
 * WordComparator.java
 *
 * Created on 20 de octubre de 2007, 18:28
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package ub.es.ubictionary.logic;
import java.util.Comparator;
/**
 *
 * @author aram
 */
public class WordComparator implements Comparator  {
    
    /** Creates a new instance of WordComparator */
    public WordComparator() {
    }

   

    public int compare(Object o1 , Object o2 ) {
        String s1 = o1.toString();
        String s2 = o2.toString();
        
        s1 = s1.substring(0, s1.indexOf("#"));
        s2 = s2.substring(0, s2.indexOf("#"));
        
        return s1.compareTo(s2);
    }
    
}
